package agh.rozproszony.model;

import java.io.Serializable;

public class Room implements Serializable {

    private int id;
    private String name;
    private int capacity;

    public Room() {
    }

    public Room(int id, String name, int capacity) {
        this.id = id;
        this.name = name;
        this.capacity = capacity;
    }

    /**
     * Pobiera Id pokoju
     *
     * @return
     */
    public int getId() {
        return id;
    }

    /**
     * Ustawia Id pokoju
     *
     * @param id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * Pobiera nazwe pokoju
     *
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * Ustawia nazwe pokoju (np. 100B)
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Pobiera pojemnosc pokoju
     *
     * @return
     */
    public int getCapacity() {
        return capacity;
    }

    /**
     * Ustawia pojemnosc pokoju
     *
     * @param capacity
     */
    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Room)) {
            return false;
        }
        return ((Room) obj).getId() == getId();
    }

    @Override
    public int hashCode() {
        return getId();
    }
}
